import rateLimit from "express-rate-limit";

export const rateLimiter = rateLimit({
	windowMs: 15 * 60 * 1000,
	max: 100,
	standardHeaders: true,
	legacyHeaders: false,
	statusCode: 429,
	message: { data: null, message: "请求次数过多" },
	handler: (_request, _response, next) => {
		next(new Error("请求次数过多"));
	},
});
